
#include <LiquidCrystal.h>

// Connections:
// rs (LCD pin 4) to Arduino pin 12
// rw (LCD pin 5) to Arduino pin 11
// enable (LCD pin 6) to Arduino pin 10
// LCD pin 15 to Arduino pin 13
// LCD pins d4, d5, d6, d7 to Arduino pins 5, 4, 3, 2
LiquidCrystal lcd(12, 7, 6, 5, 4, 3, 2);


int sensorReading = 0;  
int ledPinGreen =  13;

taskLoop(BANG)
{

   
sensorReading = analogRead(7); 
if(sensorReading>0){
delay(5);
lcd.setCursor(0,0); // set cursor to column 0, row 0 (the first row)
lcd.print("test"); // change this text to whatever you like. keep it clean.
lcd.setCursor(0,0); // set cursor to column 0, row 0 (the first row)
lcd.print("test"); // change this text to whatever you like. keep it clean.
lcd.setCursor(0,1); // set cursor to column 0, row 1
lcd.print("BANG ");
delay(100);
lcd.print("BANG ");
delay(100);
lcd.print("BANG ");
delay(100);
lcd.print("BANG ");
delay(100);
lcd.setCursor(0,2); // set cursor to column 0, row 2
lcd.print("BANG ");
delay(100);
lcd.print("BANG ");
delay(100);
lcd.print("BANG ");
delay(100);
lcd.print("BANG ");
delay(100);
lcd.setCursor(0,3); // set cursor to column 0, row 3
lcd.print("BAAAAAAAAAAAAANG ");
delay(2000);
lcd.clear();}}



taskLoop(greenLED)
{
    digitalWrite(ledPinGreen, LOW);  
    delay(1000);                     
    digitalWrite(ledPinGreen, HIGH); 
    delay(1000); 
}

void setup()   
{   

  lcd.begin(20,4); // columns, rows. use 16,2 for a 16x2 LCD, etc.
lcd.clear(); // start with a blank screen
  pinMode(ledPinGreen, OUTPUT);
  
  createTaskLoop(BANG, NORMAL_PRIORITY);
  createTaskLoop(greenLED, NORMAL_PRIORITY);
  
}


void loop()
{
      nextTask();
}

